//
//  Macro_Other.h
//  MexicoLoan
//
//  Created by WXP on 2025/2/24.
//

#define WEAKSELF __weak typeof(self) weakSelf = self;
#define STRONGSELF typeof(weakSelf) __strong self = weakSelf;

//单例
#define DECLARE_SINGLETON(CLASS_NAME) \
+ (CLASS_NAME *)sharedInstance;


#define SYNTHESIZE_SINGLETONE_FOR_CLASS(CLASS_NAME) \
+ (CLASS_NAME *)sharedInstance\
{\
static CLASS_NAME *__##CLASS_NAME##_instance = nil;\
\
static dispatch_once_t onceToken;\
dispatch_once(&onceToken, ^{\
__##CLASS_NAME##_instance = [[CLASS_NAME alloc] init];\
});\
return __##CLASS_NAME##_instance;\
}



#ifndef Macro_Other_h
#define Macro_Other_h

//结构体
struct STRUCT_XY {
    CGFloat horizonX;
    CGFloat verticalY;
};
typedef struct STRUCT_XY STRUCT_XY;
CG_INLINE STRUCT_XY
XY(CGFloat horizonX, CGFloat verticalY)
{
    STRUCT_XY size; size.horizonX = horizonX; size.verticalY = verticalY; return size;
}

//消除 PrExFristor可能导致泄漏，因为它的选择器未知，警告
#define SuppressPerformSelectorLeakWarning(Stuff) \
do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
Stuff; \
_Pragma("clang diagnostic pop") \
} while (0)


#endif /* Macro_Other_h */
